import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { HttpProvider } from '../../providers/http/http';
import { StorageProvider } from '../../providers/storage/storage';
import { DialogProvider } from '../../providers/dialog/dialog';
/**
 * Generated class for the Costlist page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
@IonicPage()
@Component({
	selector: 'page-costlist',
	templateUrl: 'costlist.html',
})
export class CostlistPage {

	type: Number;
	typename: String;
	items: Array < {
		title: string,
		name: string,
		status: string
	} > ;
	inputViewModel = {
		types: '', //流程类型
		applyName: '', //申请人
		starttime: '', //开始时间
		endtime: '' //截止时间
	};

	constructor(
		public navCtrl: NavController,
		public navParams: NavParams,
		public http: HttpProvider,
		public storage: StorageProvider,
		public dialog: DialogProvider) {
		this.type = this.navParams.get("type");
		if(this.type == 0)
			this.typename = '(待办)';
		else
			this.typename = '(已办)';
	}

	ionViewDidLoad() {
		console.log('ionViewDidLoad Costlist');
		this.loadData();
	}

	loadData() {
		//假数据初始化
		this.items = [];
		for(let i = 0; i < 20; i++) {
			this.items.push({
				title: '玉林市委组织部部长某某某率队到玉林电信参观智能党建项目,最终项目情况还待确定 ' + i,
				name: '某某某' + i,
				status: '进行中' + i
			});
		}
	}

	opendetail() {

	}
}